<template>
    <view class="content">
        <!--顶部搜索按钮区域-->
        <search-top-bar />
        <!--设计师之家-->
        <image
            class="main1"
            src="/static/images/jie.jpg"
            mode="widthFix"
            fade-show
            lazy-load
			@click="goNext('设计师之家')"
        />
        <!--案例欣赏-->
        <image
            class="main1"
            src="/static/images/guan.jpg"
            mode="widthFix"
            fade-show
            lazy-load
			@click="goNext('案例欣赏')"
        />
        <!--前沿资讯-->
        <image
            class="main1"
            src="/static/images/chao.jpg"
            mode="widthFix"
            fade-show
            lazy-load
			@click="goNext('前沿资讯')"
        />
        <swiper-list :swiperList="swiperDic1" />
    </view>
</template>

<script setup>
//import {useTopBarShow} from "@/utils/composables/scroll.js";
import { getSwiperApi } from "@/api/index.js";
import useShare from "@/utils/composables/useShare";
import searchTopBar from "@/pages/index/components/searchTopBar.vue";
import swiperList from "@/pages/index/components/swiperList.vue";
//const {topBarShow}= useTopBarShow();
const {onShareAppMessage,onShareTimeline}=useShare()
const swiperDic1 = ref([]);
const goNext = (label) => {
    switch (label) {
		case "设计师之家":
		    uni.navigateTo({
		        url: "../subPackageA/pictureCards/index?type=D1",
		    });
		    break;
        case "案例欣赏":
            uni.navigateTo({
                url: "../subPackageA/pictureCards/index?type=D2",
            });
            break;
        case "前沿资讯":
            uni.navigateTo({
                url: "../subPackageA/pictureCards/index?type=D3",
            });
            break;
        default:
            break;
    }
};
const getSwiperList = () => {
	getSwiperApi({page:'D'}).then((res) => {
	    console.log("设计--获取轮播图列表lists---",res);
		const list=res.data?.length?res.data:[];
		swiperDic1.value = list.filter(v=>v.position=='BOTTOM')?.[0]?.data||[];
 
	});
     
};
onPullDownRefresh(() => {
    getSwiperList();
    setTimeout(() => {
        uni.stopPullDownRefresh();
    }, 3000);
});
onLoad((options) => {
    console.log("onLoad----");
    getSwiperList();
});
//useShare();
</script>

<style lang="scss">
.content {
    box-sizing: border-box;
    background-color: #000;
    //background: #f7f8fa;
    .main1 {
        display: block;
        margin: 0;
        width: 100%;
        //aspect-ratio:16/9;
    }
}
</style>
